package com.wandian.texas.db;

/**
 * @author long
 * @Create 2012-10-19 下午2:44:47
 * @QQ 108232706
 * @version 1.0
 * @description PageInfo
 */
public class PageInfo {
	private int recordCount = 0;

	private int pageCount = 0;

	private int currentPage = 0;

	private int pageSize = 0;

	public PageInfo(int iCurrentPage, int iPageSize, int iRecordCount) {
		this.currentPage = iCurrentPage;
		this.pageSize = iPageSize;
		this.recordCount = iRecordCount;

		if (pageSize != 0) {
			if (this.recordCount % pageSize == 0) {
				this.pageCount = this.recordCount / this.pageSize;
			} else {
				this.pageCount = this.recordCount / this.pageSize + 1;
			}
		}
	}

	public String toString() {
		return String.format("{recordCount:%s,pageCount:%s,currentPage:%s,pageSize:%s}", recordCount, pageCount, currentPage, pageSize);
	}
}
